<template>
  <div class="searchPage"  :class="{centerControl:modeControl}">
    <div class="imgbox" v-if="modeControl">
       <span class="biaoz">BaiDu</span>
    </div>
    <div class="searchInput">
      <div class="inputLeft">
        <el-select  v-model="searchInput" placeholder="请选择文章分类或输入搜索内容" 
          allow-create multiple 
          clearable filterable remote
          default-first-option
          autocomplete
          :remote-method="remoteMethod"
          :loading="loading"
          @change="change"
          @focus="focus"
          size="medium"
          >
           
        </el-select>
      </div>
      <div class="inputRight">
          <div class="btn">搜索</div>
      </div>
    </div>
  </div>
</template>
<style scoped>
.imgbox {
  height: 229px;
  text-align: center;
  font-size: 30px;
  color: white;
  position: relative;
}
.biaoz {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%);
}
.searchPage {
  display: flex;
  flex-flow: column nowrap;
}
.centerControl {
  height: 370px;
  width: 642px;
  margin: auto;
}
.searchInput {
  height: 45px;
  margin: 5px 0;
  line-height: 45px;
  box-sizing: border-box;
  display: flex;
  position: relative;
}
.multiselect {
    line-height: 5px !important;
    height: 5px !important;
}
.inputLeft {
    flex-grow: 1;
}
.el-select {
  width: 100%;
}
.inputRight {
    width: 90px;
    position: relative;
}
.btn {
  background-color: #ccc;
  padding: .1rem 1rem;
  margin: 0 10px;
  height: 35px;
  line-height: 35px;
  position: absolute;
  top: 50%;
  transform: translate(0,-50%)
}
.imgbox {
}
</style>

<script>
import eventBus from "@/utils/eventBus"
export default {
    data() {
      return {
        searchInput:'',
        loading:false,
        options: [{
          value: '选项1',
          label: '黄金糕'
        }, {
          value: '选项2',
          label: '双皮奶'
        }, {
          value: '选项3',
          label: '蚵仔煎'
        }, {
          value: '选项4',
          label: '龙须面'
        }, {
          value: '选项5',
          label: '北京烤鸭'
        }],
      }
    },
    props:{
        // 搜索模式控制
        modeControl: {
            // true为首页模式
            default:true,
            type:Boolean

        }
    },
    methods: {
      remoteMethod(){

      },
      change(){
        console.log('选中值发生变化')
      },
      focus(){
        eventBus.$emit('on-focus',false)
      }
    }
};
</script>